<?php if (!defined('THINK_PATH')) exit();?><div class="yuList" style="display: block;">
    <table class="table table-bordered">
        <thead>
            <tr>
                <th width="10%">拍卖单号</th>
                <th width="16%">车型</th>
                <th width="6%">所在地</th>
                <th width="8%">车牌号</th>
                <?php if($status == 0): ?><th width="10%">评估师</th>
                    <th width="10%">评估师电话</th>
                <?php else: ?>
                    <th width="8%">代驾司机</th>
                    <th width="10%">代驾电话</th><?php endif; ?>

                <?php switch($status): case "0": ?><th width="12%">车主确认时间</th><?php break;?>
                    <?php case "1": ?><th width="12%">交付门店</th><th width="13%">代驾出发时间</th><?php break;?>
                    <?php case "2": ?><th width="12%">交付门店</th><th width="13%">到店时间</th><?php break; endswitch;?>
                <th width="8%">付款状态</th>
                <th width="6%">操作</th>
            </tr>
        </thead>
        <tbody>    
        <?php if(is_array($list)): $k = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><tr>
                <td><?php echo ($vo["order_no"]); ?></td>
                <td><a href="/Car/report/car_id/<?php echo ($vo["car_id"]); ?>" target="_blank"><?php echo ($vo["car_model"]); ?></a></td>
                <td><?php echo ($vo["location_area"]); ?></td>
                <td><?php echo ($vo["plate_number"]); ?></td>
                <?php if($status == 0): ?><td><?php echo ($vo["checker_name"]); ?></td>
                    <td><?php echo ($vo["checker_phone"]); ?></td>
                <?php else: ?>
                    <td><?php echo ($vo["driver_name"]); ?></td>
                    <td><?php echo ($vo["driver_phone"]); ?></td><?php endif; ?>

                    <?php switch($status): case "0": ?><td><?php echo ($vo["create_time"]); ?></td><?php break;?>
                        <?php case "1": ?><td><?php echo ($vo["delive_store_str"]); ?></td><td><?php echo ($vo["depart_time"]); ?></td><?php break;?>
                        <?php case "2": ?><td><?php echo ($vo["delive_store_str"]); ?></td><td><?php echo ($vo["arrival_time"]); ?></td><?php break; endswitch;?>
                <td><?php echo ($vo["pay_status"]); ?></td>
                <td>
                    <?php if($action_auth==true):?>
                    <?php if($status==0):?>
                        <?php if ($vo['is_lock'] == 1): ?>
                            <a href="javascript:" class="ash-grey">回车</a>
                        <?php else: ?>
                            <a href="/CarReturn/car_return_detail?oid=<?php echo ($vo["order_id"]); ?>">回车</a>
                        <?php endif ?>
                    <?php else:?>
                        <?php if($status==1):?>
                            <?php if ($vo['is_lock'] == 1): ?>
                                <a href="javascript:" class="ash-grey">到店</a>
                            <?php else: ?>
                                <a href="/CarReturn/arrival_detail?oid=<?php echo ($vo["order_id"]); ?>">到店</a>
                            <?php endif ?>
                        <?php else:?>
                            <a href="/CarReturn/arrival_detail?oid=<?php echo ($vo["order_id"]); ?>" target="_blank">查看</a>
                        <?php endif;?>
                    <?php endif;?>
                    <?php endif;?>
                </td>
            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
    <div class="pageFaye"><div class="pager"><?php echo ($page); ?></div><div class="clear"></div></div>
</div>
<!--违约-->
<div class="chenggong1">
    <span class="paidan">您确定要置为违约吗?</span>
    <div class="shenhei-btn">
        <input type="hidden" name="order_id"  value="" />
        <input type="button" value="确定" class="determine" />
        <input type="button" value="取消" class="cancel" />
    </div>
</div>
<div class="yunBei"></div>
<script>
    $("#start_time").ymdateplugin({
        changeMonth: true,
        changeYear: true
    });

    $("#end_time").ymdateplugin({
        changeMonth: true,
        changeYear: true
    });

    function violate(order_id){
        $('.chenggong1').css('display', 'block');
        $('.yunBei').css({'display':'block',"zIndex":999});
        $('input[name=order_id]').val(order_id);
    }
    $(".determine").on('click', function () {
        var order_id = $('input[name=order_id]').val();
        var param = {
            'order_id':order_id
        };
        var btn_obj = $(this);
        btn_obj.val("提交中...").attr("disabled",'disabled');
        $.post('/CarReturn/violate', param, function (data) {
            if (data.code == '200') {
                btn_alert(data.msg);
                $('.chenggong1').fadeOut();
                btn_obj.val("确定").removeAttr("disabled style");
                setTimeout(function () {
                        window.location.reload();
                    }, 500);
            } else {
                shibai_alert(data.msg)
                btn_obj.val("确定").removeAttr("disabled style");
                $('.chenggong1').fadeOut();
            }
            $('.yunBei').css({'display':'none',"zIndex":999});
        }, 'json');
    });
    $(".cancel").on('click', function () {
        $('.chenggong1').fadeOut();
        $('.yunBei').css({'display':'none',"zIndex":999});
    });
</script>